<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">
  <meta http-equiv="Expires" content="0">
  <meta http-equiv="Pragma" content="no-cache">
  <meta http-equiv="Cache-control" content="no-cache">
  <meta http-equiv="Cache" content="no-cache">
  <link rel="icon" href="data:;base64,=">
  <title>Array事件</title>
  </head>
  <style>
  *{margin:0 auto;padding:0;box-sizing:border-box;}
  html,body{position:absolute;width:100%;height:100%;min-width:1366px;min-height:768px;background: linear-gradient(skyblue,khaki);}
  /* 定义滚动条宽度 */::-webkit-scrollbar {width:4px;height:4px;}
  /*定义滚动条  轨道背景色+圆角*/::-webkit-scrollbar-track {border-radius: 2px;background-color: #555;}
  /*定义滚动条  滑块背景色+圆角*/::-webkit-scrollbar-thumb {border-radius: 2px;background-color: #C3C4C3;}
  /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  
  
  </style>
<body>


</body>
</html>
<script>
 var obk=Object.defineProperty;

var arr=[];

var data=[0,1,2,3,4,5]

var list=['push','unshift','pop','shift','splice','sort','reverse','concat']
var fun=function(data){
   let d=data;
   let yx=Array.prototype;
       list.forEach((v)=>{
             var yxF=yx[v];  //原型方法
                d[v]=function(){
                    var t=this,m=arguments;
                    var d=yxF.apply(t,m);
                        console.log('事件  =>  '+v);
                        return d;
                };
                obk(d,v,{enumerable:false,writable:false,configurable:false});
       });
       d.$type='array';
       obk(d,'$type',{enumerable:false,writable:false,configurable:false});
       
};
fun(data);



</script>